type MyNonNullable<T> = T extends null | undefined ? never : T

type MyT = NonNullable<string | number | undefined>
// type MyT = string | number